package myky.com.doctorapp.presenter

import io.reactivex.disposables.Disposable
import myky.com.doctorapp.entity.RemoteListEntity
import myky.com.doctorapp.base.BasePresenterIm
import myky.com.doctorapp.base.RxSubscribe
import myky.com.doctorapp.contract.RemoteDoctorListContract
import myky.com.doctorapp.model.RemoteDoctorListModel

/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/1/9 on 10:00
 */
class RemoteDoctorListPresenter : BasePresenterIm<RemoteDoctorListContract.View>(),RemoteDoctorListContract.Presenter {

    private var remoteDoctorListModel:RemoteDoctorListModel= RemoteDoctorListModel()
    override fun findRemoteDoctorList() {

        remoteDoctorListModel.getRemoteDoctorList().subscribe(object :RxSubscribe<RemoteListEntity.PayLoadBean>(){
            override fun onSuccess(t: RemoteListEntity.PayLoadBean?) {

                var t1 = t?.hospitalList

                if (t != null) {
                    mView.showRemoteDoctorList(t)
                }
            }

            override fun onFailed(code: Int, msg: String?) {

            }

            override fun onSubscribe(d: Disposable) {

                addSubscription(d)
            }


        })
    }

}